﻿using System;
using System.Collections.Generic;
using System.Text;
using Watchdog.Dal;
using Watchdog.Bll;
using Watchdog.Bll.Base;

namespace Watchdog.Bll.Factory {

    public partial class TestHistoryFactory {
        public static void Delete ( TestHistoryBase testhistory ) {
            DataClient.Current.TestHistoryDelete ( testhistory.IntData );
        }

        public static TestHistory GetById ( int id ) {
            return new TestHistory (DataClient.Current.TestHistoryGetById (id));
        }
				
        public static List<TestHistory> GetByTest ( int test ) {
		    List<TestHistory> outlist = new List<TestHistory> ();
            Watchdog.Facade.TestHistory[] list = Dal.DataClient.Current.TestHistoryGetByTest ( test );
            foreach (Watchdog.Facade.TestHistory item in list)
                outlist.Add (new TestHistory (item));
            return outlist;
            // return DataClient.Current.TestHistoryGetByTest ( test );
        }
        public static void Insert ( TestHistoryBase testhistory ) {
            testhistory.IntData = DataClient.Current.TestHistoryInsert ( testhistory.IntData );
        }
		
        public static void Update ( TestHistoryBase testhistory ) {
            DataClient.Current.TestHistoryUpdate ( testhistory.IntData );
        }
		
	}
}
